import datetime
import time , os

def get_time():
    # time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))
    # day = int(time.strftime('%d',time.localtime(time.time())))
    # hour = int(time.strftime('%d',time.localtime(time.time())))
    # minute = int(time.strftime('%M',time.localtime(time.time())))
    # second = int(time.strftime('%S',time.localtime(time.time())))
    # time_stamp = day*24*60*60 + hour*60*60 + minute * 60 + second
    # time_stamp = int(str(datetime.datetime.now()).split('.')[1]) + int(time.strftime('%S', time.localtime(time.time()))) * 1000
    time_stamp = datetime.datetime.now()

    return time_stamp

def difference(times , timee):
    print('每次做减法，countTIme',times,timee,timee - times)
    return (timee - times).total_seconds() * 1000


def sleep_a(t):
    time.sleep(t)
# # second1 = int(time.strftime('%S',time.localtime(time.time())))
# begin1 = datetime.datetime.now()
# # begin = int(str(begin1).split('.')[1]) + second1 * 1000
# begin = int(str(datetime.datetime.now()).split('.')[1]) + int(time.strftime('%S', time.localtime(time.time()))) * 1000
# time.sleep(3.5)
# # second2 = int(time.strftime('%S',time.localtime(time.time())))
# end1 = datetime.datetime.now()
# # end = int(str(end1).split('.')[1]) + second2 * 1000
#end = int(str(datetime.datetime.now()).split('.')[1]) + int(time.strftime('%S', time.localtime(time.time()))) * 1000
# k = end - begin
# k = end1 - begin1
# print(k,'\n',k.total_seconds(),'\n',k.total_seconds()*1000)
# # second = int(time.strftime('%S',time.localtime(time.time())))
# # print(int(str(k).split('.')[1]) + second * 1000)
# print(type(k))
# print('1',datetime.datetime.now())
# time.sleep(1)
#
# print('2',datetime.datetime.now())
# print('3',datetime.datetime.now())
# print('4',datetime.datetime.now())
# print('5',datetime.datetime.now())
# time.sleep(1)
# print('5',datetime.datetime.now())
# for i in range(20):
#     d1=datetime.datetime.now()
#     time.sleep(1)
#     d2=datetime.datetime.now()
#     print((d1-d2).seconds)